module.exports = {
  nav_name: '活动管理', //生成导航菜单
  module_name: 'activity_manager',  //生成路径，与模块名相同
  api: `{
    page: commonPath + "/admin/active/page", // 分页
    del: commonPath + "/admin/active/remove", //删除
    add: commonPath + '/admin/active/save', //新增
    detail: commonPath + '/admin/active/get', //详情
    edit: commonPath + "/admin/active/edit", //编辑
    changeState: commonPath + "/admin/active/editState", //编辑状态
  }`,
  table: {
    nav_name: "活动列表",
    tipsText: "活动管理 >> 活动列表",
    //获取列表页面
    tableData: [
      { title: '序号', name: 'index', type: "normal" },
      { title: '活动名称', name: 'title', type: "normal" },
      { title: '发布时间', name: 'gmtModified', type: "normal", showObj: "{}" },
      { title: '状态', name: 'state', type: "opts",
        showName: "stateOpts",
        showObj: `{
          "1": "上架",
          "2": "下架",
        }`
      },
    
    ],
    tableOptLen: "300",
    tableOpt: [
      // {
      //   type: "view",
      //   text: "查看",
      //   request: false,
      //   jump: "/member_manager/see_detail_member"
      // },
      {
        type: "changeState",
        text: "上架",
        request: true,
        url: "API.activity_manager.changeState",
        requestType: 'post',
        params: `{id,  state: 1 }`, //必须为文本
        methodNameTag: 'Open', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '2'`,  //展示条件，没有就不传或置为空
      },
      {
        type: "changeState",
        text: "下架",
        request: true,
        url: "API.activity_manager.changeState",
        requestType: 'post',
        params: `{id,  state: 2 }`, //必须为文本
        methodNameTag: 'Close', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '1'`,  //展示条件，没有就不传或置为空
      },
      {
        type: "modify",
        text: "编辑",
        request: false,
        jump: "/activity_manager_add_page"
      },
      

      {
        type: "del",
        text: "删除",
        request: true,
        url: "API.activity_manager.del",
        requestType: 'get',
        // isSplitSearchString: "true", //是否拼接查询字符串在链接结尾
      },
     
      // {
      //   type: "changeState",
      //   text: "启用",
      //   request: true,
      //   url: "API.member_manager.del",
      //   requestType: 'post',
      //   params: `{ state: 1 }`,
      //   methodNameTag: 'Enable', //方法衔接拓展名 用于标志不同方法
      // },
    ],
    search: {
      contentArr: {
        input1: {
          labelName: '活动名称', inputName: 'title'
        },
      },
      searchBtn: {
        text: "查询", //链接与table请求接口相同，不做另外配置
      },
      addBtn: {
        //搜索栏具有添加功能按钮时，设置此字段
        type: "add",
        text: "新增",
        request: false,
        jump: "/activity_manager_add_page", //后期设置成自动的
      }
    },
  },


  //添加页面
  add_page: {
    isGenerate: 'false',
    tipsText: "活动管理 >> 活动", //添加/编辑
    formData: {
      titleText: "请填写活动信息",
      input1: {
        labelName: '活动标题',
        inputName: 'title',
        isNeed: 'true',
      },
      textarea2: {
        labelName: '活动简介',
        inputName: 'intr',
        isNeed: 'true',
        rows: "5",
        width: "360", //自动补全px
        isNeed: 'true',
      },
      uploadImg3: {
        labelName: "活动展示",
        inputName: "activeImg",
        type: "many", //type: "single"
        countLimit: "1",
        uploadMethod: "handleUploadLogo",
        isNeed: 'true',
      },
      input4: {
        labelName: '详细地址',
        inputName: 'addr',
        isNeed: 'true',
      },
      input5: {
        labelName: '经度',
        inputName: 'latitude',
        isNeed: 'true',
      },
      input6: {
        labelName: '纬度',
        inputName: 'longitude',
        isNeed: 'true',
      },
      //控件更改
      // input11: {
      //   labelName: '活动开始时间',
      //   inputName: 'startDate',
      //   isNeed: 'true',
      // },
      // input12: {
      //   labelName: '活动结束时间',
      //   inputName: 'endDate',
      //   isNeed: 'true',
      // },
      date1: {
        labelName: '活动时间',
        inputName: 'upLoadTime', //仅用于标志
        dateConfig: {
          startDateName: 'startDate',
          endDateName: 'endDate',
          dateChangeMethodsName: 'handleUploadDateChange'
        },
        isNeed: 'true'
      },
      input13: {
        labelName: '活动人数限制',
        inputName: 'restrictNum',
        isNeed: 'true'
      },
      input14: {
        labelName: '负责人',
        inputName: 'principal',
        isNeed: 'true'
      },
      input15: {
        labelName: '联系电话',
        inputName: 'tel',
        isNeed: 'true'
      },
      input16: {
        labelName: '报名费用',
        inputName: 'fee',
        isNeed: 'true'
      },
      select17: {
        labelName: '付费方式',
        inputName: 'payType',  //输入绑定的变量
        selectOptsName: "payTypeOpts",
        selectOptsArr: `[
            { value: "1", label: "线上" },
            { value: "2", label: "线下" },
          ],
          `, //选项数组
      },
      // //图片上传
      // uploadImg1: {
      //   labelName: "轮播图上传",
      //   inputName: "img",
      // },
      // //三级联动组件
      // address1: {
      //   label: "地址选择",
      //   inputName: "",
      // }
    },
    //添加按钮
    addBtn: {
      text: '立即添加',
      url: "API.activity_manager.add"
    },
    //编辑按钮
    editBtn: {
      text: '编辑',
      detailUrl: "API.activity_manager.detail",
      detailType: 'get',
      detailParams: {},  //这里是对象,非字符串, 只能写给定值的参数
      // detailDataFormatCode: //额外的数据处理代码
      //   ` this.formData.pwd = "";
      // `,
      editUrl: "API.activity_manager.edit",
      isSplitSearchString: "true", //是否拼接查询字符串在链接结尾
      jump: '/activity_manager_table',
    },
    //添加 编辑提交校验代码补充
    // submitCheckCode: `
    //   if(this.formData.pwd != this.formData.comfirmPwd) {
    //     this.$alert("两次密码输入必须一致");
    //     return;
    //   }
    // `,
    //取消按钮
    cancelBtn: { text: "返回" }, //
  },

  // //详情页面
  // detail_page: {

  // }
}
